<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <title><#if entity.refundId??>编辑<#else>新增</#if>退款记录表</title>
    <#include "/view/admin/head.html"/>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" />


    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/js/bootstrapValidator.min.js"></script>
    <script type="text/javascript" src="${base}/jstool/bootstrap-validator-0.5.3/lang/zh_CN.min.js"></script>
    <link rel="stylesheet" type="text/css" href="${base}/jstool/bootstrap-validator-0.5.3/css/bootstrapValidator.min.css" />


    <style type="text/css">
        .list-path {
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;
        }

        .table-class {
            width: 90%;
            text-align: center;
            border: 1px solid #afd9ee;
            margin: 0 auto;
            margin-top: 50px;
        }

        table th {
            width: 20%;
            background-color: #d9edf7;
            text-align: right;
        }

        table td {
            width: 20%;
            text-align: left;
        }


    </style>
    <script type="text/javascript">
    function refundStatus(status){
        var txt = "?";
        txt+=("refundId="+$('#refundId').val());
        txt+="&";
        txt+=("refundStatus="+status);
        txt+="&";
        txt+=("businContent="+$('#businContent').val());
        location.href="${base}/czjrefund/saveBusinContent.do"+txt;
    }
        $(function(){
            //初始化










            $('#czjrefundForm').bootstrapValidator({
                message: 'This value is not valid',
                feedbackIcons: {
                    valid: 'glyphicon glyphicon-ok',
                    invalid: 'glyphicon glyphicon-remove',
                    validating: 'glyphicon glyphicon-refresh'
                },
                fields: {

                    businContent:{
                    message: '输入商家退款说明出错',
                    validators:{
                        notEmpty: {
                            message: '商家退款说明不能为空'
                        },
                        stringLength:{
                            max: 255,
                            message: '商家退款说明不能超过 255个字符'
                        }
                    }
                }
                }
            });


        });

    </script>
</head>
<body>
<#include "/view/admin/listnav.html"/>


<div class="table-class">
    <#include "/view/admin/opermsg.html"/>
    <form id="czjrefundForm" action="${base}/czjrefund/save.do"
     >
    <table class="table table-bordered">

        <input type="hidden" style="display: none" id="refundId" name="refundId" value="${entity.refundId!}"/>



        <tr>
            <th>订单号</th>
            <td>
                ${entity.orderCode!}
            </td>




            <th>用户</th>
            <td>
                <#if entity.userinfoId??>
                    <#list listUserinfoId as lv>
                        <#if lv.value??&&entity.userinfoId == lv.value >
                            ${lv.name!}
                        </#if>
                    </#list>

                </#if>
            </td>
        </tr>


        <tr>
            <th>退款金额</th>
            <td>
                ${entity.refundAmount!}
            </td>




            <th>创建时间</th>
            <td>
                <#if (entity.createtime)?? >${entity.createtime?string('yyyy-MM-dd HH:mm:ss')}</#if>
            </td>
        </tr>


        <tr>
            <th>退款状态${entity.refundStatus!}</th>
            <td>
                <#if entity.refundStatus??>
                <#if 0==entity.refundStatus><span class="label label-default">待退款</span></#if>
                <#if 1==entity.refundStatus><span class="label label-success">退款成功</span></#if>
                <#if 2==entity.refundStatus><span class="label label-danger">退款失败</span></#if>
                </#if>
            </td>

        </tr>
        <tr>

            <th>用户申请退款说明</th>
            <td colspan="3">
                ${entity.userContent!}
            </td>
        </tr>


        <tr>
            <th>商家退款说明 </th>
            <td colspan="3">
                <#if entity.refundStatus??>
                <#if 0==entity.refundStatus>
                    <div class="form-group">
                        <input type="text" class="form-control" id="businContent" name="businContent" placeholder="请输入商家退款说明" value="${entity.businContent!}">
                    </div>

                    <#else>
                        ${entity.businContent!}
                </#if>
                    <#else>  ${entity.businContent!}
                </#if>
            </td>
        </tr>



        <tr>
            <td colspan="4" width="100%" style="text-align: center;">
                <#if entity.refundStatus??>
                    <#if 0==entity.refundStatus>
                    <a class="btn btn-success " href="javascript:refundStatus(1)">
                        </span>同意退款</a>
                        <span style="width: 20px;">&nbsp;</span>
                    </#if>
                    <#if 0==entity.refundStatus>
                    <a class="btn btn-danger " href="javascript:refundStatus(2)">
                        </span>拒绝退款</a>
                    </#if>
                </#if>

            </td>
        </tr>

    </table>
</form>




</div>

<script type="text/javascript">

</script>


</body>
</html>
